home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -in_the_mag- / reader_requests / scilab / demos / bike / macros / velodp.sci < prev   
Text File  |  1999-09-16  |  1KB  |  38 lines

  1. //[]=velodp(i)
  2. //------------ generation of the rear wheel
  3. nnn=24
  4. i1=(i-1)*nstep+1
  5. ang=xx(6,i1)*i1/n2
  6. l=(1/nnn)*( (2*%pi+ang)*(0:nnn)+ ang*(ones(1,nnn+1)-(0:nnn)))'
  7. dec = ones(l);sinl=r1*sin(l);cosl=r1*cos(l);
  8.   cphi1=cos(xx(4,i1));
  9.   sphi1=sin(xx(4,i1));
  10.   cthe1=cos(xx(5,i1));
  11.   sthe1=sin(xx(5,i1));
  12.   xrearar = cosl*cphi1-sinl*(sphi1.*cthe1)+dec*xx(1,i1);
  13.   yrearar=  cosl*sphi1+sinl*(cphi1.*cthe1)+dec*xx(2,i1);
  14.   zrearar = sinl*sthe1+dec*xx(3,i1);
  15. ang=xx(20,i1)*i1/380
  16. l=(1/nnn)*( (2*%pi+ang)*(0:nnn)+ ang*(ones(1,nnn+1)-(0:nnn)))'
  17. dec = ones(l);sinl=r1*sin(l);cosl=r1*cos(l);
  18.   cphi1=cos(xx(18,i1));
  19.   sphi1=sin(xx(18,i1));
  20.   cthe1=cos(xx(19,i1));
  21.   sthe1=sin(xx(19,i1));
  22.   xfrontar = cosl*cphi1-sinl*(sphi1.*cthe1)+dec*xx(21,i1);
  23.   yfrontar=  cosl*sphi1+sinl*(cphi1.*cthe1)+dec*xx(22,i1);
  24.   zfrontar = sinl*sthe1+dec*xx(23,i1);
  25.   [xnf,ynf]=geom3d(xfrontar,yfrontar,zfrontar);
  26.   [xnr,ynr]=geom3d(xrearar,yrearar,zrearar);
  27.   [nn2,nn1]=size(xnr);
  28.   xx1=[xnf(1:nn2/2)';xnf((nn2/2+1):nn2)'];
  29.   yy1=[ynf(1:nn2/2)';ynf((nn2/2+1):nn2)'];
  30.   xsegs(xx1,yy1);
  31.   xx1=[xnr(1:nn2/2)';xnr((nn2/2+1):nn2)'];
  32.   yy1=[ynr(1:nn2/2)';ynr((nn2/2+1):nn2)'];
  33.   xsegs(xx1,yy1);
  34. //end
  35.  
  36.  
  37.  
  38.